import pymysql


def main():
    coon = pymysql.connect(host='120.77.222.222', port=2206, user='', password='xxxx', db='', charset='uft8')

    with coon.cursor() as  cursor:
        result = cursor.execute('insert into tb_dept values (90,"x","XX")')
        if result == 1:
            print('插入成功')

    print(coon)


def main001():
    coon = pymysql.connect(host='120.77.222.222', port=2206, user='', password='xxxx', db='', charset='uft8')

    with coon.cursor() as  cursor:
        cursor.execute('select a,b,c from XXX')

    for row in cursor.fetchall():
        print(row)

    print(coon)


"""
def __init__(self, host=None, user=None, password="",
                 database=None, port=0, unix_socket=None,
                 charset='', sql_mode=None,
                 read_default_file=None, conv=None, use_unicode=None,
                 client_flag=0, cursorclass=Cursor, init_command=None,
                 connect_timeout=10, ssl=None, read_default_group=None,
                 compress=None, named_pipe=None,
                 autocommit=False, db=None, passwd=None, local_infile=False,
                 max_allowed_packet=16*1024*1024, defer_connect=False,
                 auth_plugin_map=None, read_timeout=None, write_timeout=None,
                 bind_address=None, binary_prefix=False, program_name=None,
                 server_public_key=None):
"""

if __name__ == '__main__':
    main()
